<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Gerenciador de Estoque</title>
    </h:head>
    <h:body>
        <center>
            <h:form>
                <h:graphicImage id="logo" width="350" height="200" url="http://static.wixstatic.com/media/f3611f_f23a8ea76443e56fddfeca51f456962a.png"/>
                <br/>
                <h:outputText value="Controle de Estoque" style="font-size: 50px; font-style: oblique"/>
                <br/>
                <br/>
                <h:outputLabel value="Valor Total de Compras: "/><h:outputLabel value="#{indicadoresBean.ind.valorTotalEstoque}" />
                <h:commandButton value="Atualizar Indicadores" action="#{indicadoresBean.atualizarIndicadores}"/>
                <h:panelGrid columns="3" title="Escolha as opções!">
                    <h:commandLink value="| Cadastrar Estoque |" action="cadProduto"/>
                    <h:commandLink value="Cadastrar Produtos Prontos |" action="cadProdutoPronto"/>
                    <h:commandLink value="Cadastrar Insumos |" action="cadInsumos"/>
                </h:panelGrid><br/>
                <h:panelGrid columns="2">
                    <h:dataTable id="insumosTable" value="#{produtoBean.listaprodutos}" var="data" border="1">
                        <h:column>
                            <f:facet name="header">ID</f:facet>
                                #{data.id}
                        </h:column>
                        <h:column>
                            <f:facet name="header">NOME</f:facet>
                                #{data.nome}
                        </h:column>
                        <h:column>
                            <f:facet name="header">ESTOQUE</f:facet>
                                #{data.estoque}
                        </h:column>
                        <h:column>
                            <f:facet name="header">ESTOQUE_MÍNIMO</f:facet>
                                #{data.estoqueMinimo}                            
                        </h:column>
                        <h:column>
                            <f:facet name="header">PREÇO_COMPRA</f:facet>                            
                            <h:outputText value="#{data.precoCompra}">
                                <f:convertNumber type="currency" currencySymbol="R$ "/>
                            </h:outputText>
                        </h:column>
                        <h:column>
                            <f:facet name="header">PREÇO_QNT</f:facet>
                            <h:outputText value="#{data.precoPorQuantidade}">
                                <f:convertNumber type="currency" currencySymbol="R$ "/>
                            </h:outputText>                                
                        </h:column>
                    </h:dataTable>
                    <h:dataTable id="produtosTable" value="#{produtoBean.listaprodutos}" var="data" border="1">
                        <h:column>
                            <f:facet name="header">ID</f:facet>
                                #{data.id}
                        </h:column>
                        <h:column>
                            <f:facet name="header">NOME</f:facet>
                                #{data.nome}
                        </h:column>
                        <h:column>
                            <f:facet name="header">ESTOQUE</f:facet>
                                #{data.estoque}
                        </h:column>
                        <h:column>
                            <f:facet name="header">ESTOQUE_MÍNIMO</f:facet>
                                #{data.estoqueMinimo}
                        </h:column>
                        <h:column>
                            <f:facet name="header">PREÇO_COMPRA</f:facet>
                                #{data.precoCompra}
                        </h:column>
                        <h:column>
                            <f:facet name="header">PREÇO_QNT</f:facet>
                                #{data.precoPorQuantidade}
                        </h:column>
                    </h:dataTable>
                </h:panelGrid>
            </h:form>
        </center>
    </h:body>
</html>

